Fix the VM.is_a_template flag for domain 0.
authorEwan Mellor <ewan@xensource.com>
Sun, 25 Mar 2007 23:09:00 +0000 (00:09 +0100)
committerEwan Mellor <ewan@xensource.com>
Sun, 25 Mar 2007 23:09:00 +0000 (00:09 +0100)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendAPI.py
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/XendDomainInfo.py

index 01c2f0a6ce8f27dd5ecc7ba7e230468b7d4fcd4a..63da4a613888c970ac96320d49ffe4c0187a7e81 100644 (file)
@@ -1546,7 +1546,7 @@ class XendAPI(object):
             'name_label': xeninfo.getName(),
             'name_description': xeninfo.getName(),
             'user_version': 1,
-            'is_a_template': xeninfo.info.get('is_a_template'),
+            'is_a_template': xeninfo.info['is_a_template'],
             'auto_power_on': False,
             'resident_on': XendNode.instance().uuid,
             'memory_static_min': xeninfo.get_memory_static_min(),
@@ -1576,7 +1576,7 @@ class XendAPI(object):
             'tools_version': xeninfo.get_tools_version(),
             'other_config': xeninfo.info.get('other_config', {}),
             'domid': domid is None and -1 or domid,
-            'is_control_domain': xeninfo == xendom.privilegedDomain(),
+            'is_control_domain': xeninfo.info['is_control_domain'],
             'metrics': xeninfo.get_metrics()
         }
         return xen_api_success(record)
index 9600433d07f6c29920c21e4ae4181e4815dc750c..a93c0645512738264b09b4fe3bef47e2e0f43f6d 100644 (file)
@@ -298,6 +298,8 @@ class XendConfig(dict):
             'actions_after_reboot': 'restart',
             'actions_after_crash': 'restart',
             'actions_after_suspend': '',
+            'is_template': False,
+            'is_control_domain': False,
             'features': '',
             'PV_bootloader': '',
             'PV_kernel': '',
index 7c1d9614c44ecf7033d15b3a2b7843ae48195a48..356cf4b947cfec55afcb73699b9876eb0a786622 100644 (file)
@@ -127,6 +127,8 @@ def recreate(info, priv):
     assert not info['dying']
 
     xeninfo = XendConfig.XendConfig(dominfo = info)
+    xeninfo['is_control_domain'] = priv
+    xeninfo['is_a_template'] = False
     domid = xeninfo['domid']
     uuid1 = uuid.fromString(xeninfo['uuid'])
     needs_reinitialising = False